First create a workspace that contains env. We will be using bit with vue.js for the setup. It can be used with other frontend libraries as well.
copy
bit new vue my-workspace --env teambit.vue/vue --default-scope my-org.my-scope
Attached a screenshot of the folder structure after creating workspace and setting up env.
Folder structure
The above setup initialises the workspace.
To know more about Bit workspace click here.
Components can be created using templates, as of now bit has 4 vue templates types.
Run the command to check the available templates.
copy
bit templates
All available vue templates
vue (A vue component template. Can be used for Vue components.)
vue-composable (A vue composable template. Can be used for Vue composables.)
vue-app (A vue application template. Can be used for Vue applications.)
vue-env (A vue env template. Can be used for creating your own Vue env.)
Lets create vue application with name my-app and start the application.
copy
bit create vue-app apps/my-app
bit use apps/my-app // this makes the app lodable in workspace
Folder structure
Start the application using following command
copy
bit run my-app-app
Application name my-app-app can be changed by changing the name property value stored in my-app.vue-app.cjs.
File name - my-app.vue-app.cjs
When you run the application you can see a counter present on screen. This is the default code present in the template. Delete the unwanted code and library vue-router to the application.
Default screen of application
Run the following command to install vue-router and setup vue router in my-app.